
	<div class="form-list">
		<?php admin_msg( $msg ); ?>
		<form name="list" action="<?php echo $form ?>" method="post">
		
		<div class="box-right">
			<?php admin_cat_combo( $menu_cat, $cat_id, 1, 2 ); ?>
			<input type="button" name="button" onclick="submit_url( 'product/index/' )" value="Hiển thị" class="button" />
		</div>
		
		<div class="clear-all"></div>
		
		<table border="1" class="form-list-table">
			<tr>
				<th rowspan="2" width="50">TT</th>
				<th rowspan="2" width="60">Ảnh</th>
				<th rowspan="2" class="title">Tên sản phẩm</th>
				<th colspan="6" width="375">Tùy chọn</th>
			</tr>
			<tr>
            	<th width="60">Home</th>
            	<th width="60">Mới</th>
				<th width="70">Tiêu biểu</th>
				<th width="65">Hiển thị</th>
				<th width="60">Sửa</th>
				<th width="60">Xóa</th>
			</tr>
			<?php 
			if ( $items ) {
				
				$k = 1;
				foreach ( $items as $item ) {
					
					$h = ( $item['home'] == 1 ) ? 'checked="checked"' : '';
					$n = ( $item['new'] == 1 ) ? 'checked="checked"' : '';
					$f = ( $item['focus'] == 1 ) ? 'checked="checked"' : '';
					$s = ( $item['status'] == 1 ) ? 'checked="checked"' : '';
										
					echo '<tr>';
						echo '<td><input type="hidden" name="id_'.$k.'" value="'.$item['id'].'" /><input name="order_'.$k.'" value="'.$item['orders'].'" type="text" class="text text-numb2" /></td>';
						echo '<td>';
							if ( $item['image'] ) {
								$find = 'http://';
			 					$pos = strpos( $item['image'], $find );
			 					
			 					if ($pos !== false) 
			 						echo '<p><a target="_blank" href="'.$item['image'].'"><img src="'.$item['image'].'" alt="" width="50" /></a></p>';
			 					else 
			 						echo '<p><a target="_blank" href="'.admin_gallery().$item['image'].'">'.image_thumb($item['image'], 'product', 50, 50).'</a></p>';	
							
							}else echo '<img src="'.admin_img().'no-images.jpg" alt="No-image" width="50" />';	
						echo '</td>';
						echo '<td class="title">';
							echo '<strong>'.$item['name'].'</strong>';
							if ( $item['tags']) {
								echo '<p><strong>Tags:</strong> '.$item['tags'].'</p>';
							}
						echo '</td>';
						echo '<td><input '.$h.' type="checkbox" name="home_'.$k.'" value="1" /></td>';
						echo '<td><input '.$n.' type="checkbox" name="new_'.$k.'" value="1" /></td>';
						echo '<td><input '.$f.' type="checkbox" name="focus_'.$k.'" value="1" /></td>';
						echo '<td><input '.$s.' type="checkbox" name="status_'.$k.'" value="1" /></td>';
						echo '<td><a href="'.admin_link( 'product/edit/'.$item['id'] ).'" class="edit"><img width="20" height="19" src="'.admin_img().'spacer.gif" alt="Xóa" /></a></td>';
						echo '<td><a onclick="return confirm_del();" href="'.admin_link( 'product/del/'.$cat_id.'/'.$p_current.'/'.$item['id'] ).'" class="del"><img width="20" height="20" src="'.admin_img().'spacer.gif" alt="Xóa" /></a></td>';
					echo '</tr>';
					$k++;
				}
				
				echo '<tr><td colspan="9" class="no-data"><input type="hidden" name="length" value="'.$k.'" />Có tổng số <strong>'.$total.'</strong> sản phẩm</td></tr>';
				
			}else  echo '<tr><td colspan="9" class="no-data">Chưa có sản phẩm nào được tạo</td></tr>';
			?>								
		</table>
		
		<div class="box-right">
			<input type="submit" name="submit" value="Cập nhập" class="button" />
		</div>
		
		<div class="clear-all"></div>
		
		<?php 
		if ( $paging ) {
			echo '<div class="phantrang">';
				echo $paging ;
			echo '</div>';
		}
		?>	
		</form>
	</div>